import { defineStore } from 'pinia';

export const useProductStore = defineStore('product', {
  state: () => ({
    products: [
      { id: 1, name: 'Apple', price: 5 },
      { id: 2, name: 'Banana', price: 3 }
    ]
  }),
  getters: {
    getProductById: (state) => (id) => {
      return state.products.find(product => product.id === id);
    }
  }
});
